<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-过期商品管理">
</@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css" />

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 商品管理 <span class="c-gray en">&gt;</span> 过期商品管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
<form method="post" name="query_expire_product_form"  id="query_expire_product_form" action="${contextPath}/product/query_expire_product_list" >    
    <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />                        
    <input type="hidden" id="productIds" value="" name="productIds"/>
    <div class="text-c">
        <table class="table search_table">
           <tr>  
           <td>商品名称：</td>
           <td><input type="text" class="input-text  radius"  placeholder="商品名称" id="" name="proName" value="${productQo.proName}"></td>     
           <td>商品编号：</td>
           <td><input type="text" class="input-text  radius"  placeholder="商品编号" id="" name="prodId" value="${(productQo.prodId?c)!}" ></td>
           <td>商品分类：</td>
           <td>
             <span class="select-box radius">
               <select class="select"  name="proType" >   
                 <option value>请选择</option>
                 <#list prodTypeList as list>  
                 <option value="${list.id?c}" <#if list.id==productQo.proType>selected="selected"</#if>>${list.name}</option>
                 </#list>
               </select>
             </span>  
           </td>  
          </tr>
          <tr>
           <td>供应商：</td>
           <td>
           <span class="select-box radius">
           <select class="select"  name="merchantQo.id" >
           <option value>请选择</option>
             <#list merchantNewList as list>  
                 <option value="${list.id?c}" <#if list.id==productQo.merchantQo.id>selected="selected"</#if>>${list.mercName}</option>
             </#list>
           </select>
           </span>
           </td>  
          
          
           <td>商品过期时间：</td>
           <td><input  type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',readOnly: true })" id="startDate" 
               value='${(productQo.expireBeginDate?string("yyyy-MM-dd"))!}' name="expireBeginDate"  class="input-text Wdate"  style="width:45%;">
                                                至
               <input  type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'startDate\')}',maxDate:'%y-%M-%d',readOnly: true })" id="endDate" 
               value='${(productQo.expireEndDate?string("yyyy-MM-dd"))!}' name="expireEndDate"    class="input-text Wdate"  style="width:45%;">
           </td>
           <td></td>
           <td>
           <input class="btn btn-success radius" type="button"  onclick="search();"  value="搜索" />
           <input class="btn btn-success radius" type="button"  onclick="toIsEmpty();" value="重置" />
           <input class="btn btn-success radius" type="button"  onclick="slimport();"   value="导出" />
             </td>
         </tr>
      </table>
    </div>
</form>

    <div class="cl pd-5 bg-1 bk-gray"> 
    <span class="l">  
    <a href="javascript:;" onclick="setNotBuyProduct('设置过期商品','${contextPath}/product/query_not_buy_product_list',1100,600);" class="btn btn-primary radius"> 设置过期商品</a> 
    </span>
    <span class="r">共有数据：<strong>${pagination.totalCount}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr  class="text-c">
            <th >商品编号</th>
            <th >商品名称</th>
            <th >商品类别</th>
            <th >供应商</th>
            <th >商品上传时间</th>
            <th >商品过期时间</th>
            <th >状态</th>
            <th >在线库存</th>
            <th >警戒库存</th>
            <th >操作</th>
        </tr>
        </thead>
        <tbody>
       <#if pagination.list?? && (pagination.list?size &gt; 0) >
        <#list pagination.list as product> 
             <tr  class="text-c">
                <td>${product.id?c}</td>
                <td>${product.baseInfo.name}</td>
                <td>${product.productProperty.prodTypeOne.name}&lt;
                  ${product.productProperty.prodTypeTwo.name} &lt;
                  ${product.productProperty.prodTypeThree.name}
                </td>
                <td>${product.merchant.mercName}</td>
                <td>
                    <#if product.updateDate??>
                       ${product.updateDate?string("yyyy-MM-dd")}  
                       <#else>
                       ${product.createDate?string("yyyy-MM-dd")}  
                    </#if>
                </td>
                <td>${(product.expireDate?string("yyyy-MM-dd"))!}</td>
                <td>已过期</td>
                <td>${product.storeInfo.storeNum}</td>
                <td>${product.storeInfo.warnStoreNum}</td>
                <td>
               	<a href="javaScript:void(0);" onclick="javaScript:downProduct(${product.id?c})">恢复正常</a>
				<a href="javaScript:void(0);" onclick="look_product('查看商品','${contextPath}/product/look_product?prodId=${product.id?c}','1000','600')">查看详情</a>							
                </td>
        </tr>
      </#list></#if>
     </tbody>
    </table>
    <div id="div_page" style="padding-top: 10px;float: right"></div>
</div>
<@frame.end "default">
</@frame.end>
</html>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/product/query_expire_product_list.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'div_page',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
	skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
	last: ${pagination.totalPage}, //将尾页显示为总页数。若不显示，设置false即可
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
            $("#page").val(obj.curr);
            $("#query_expire_product_form").submit();
        }
    }
})  
</script>